/*
 * Copyright 2011 Clean GWT
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.cleangwt.uibinder.client;

import com.google.gwt.uibinder.client.UiField;

/**
 * Implement this interface and use GWT.create() to instantiate target class and generate
 * implementation method for creating a {@link TemplatPanel} to load a html template. For
 * {@link UiField}-tagged fields, that will be bound with respective element of template. Differs
 * from {@link RequiresTemplate} using {@link ClientBundle}, the web template is retrieved by
 * sending http request.
 * 
 * @author Jess
 * @version 1.0
 * @since 1.0
 */
public interface RequiresWebTemplate extends RequiresRebind {
  /**
   * Creates a {@link TemplatePanel} to load a html template and wrapping existing template elements
   * into respective t or replacing them by fields. (via ajax request, the template may not be
   * initialized immediately, but as it respond the {@link #onWebTemplateLoad()} is called.)
   * 
   * @return the template panel
   */
  TemplatePanel createTemplate();

  /**
   * Called when web template loaded.
   */
  void onWebTemplateLoad();
}
